#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back
#define y1 y_alpha_1

using namespace std;

using ll = long long;
using db = double;
using vec = vector<int>;
using pii = pair<int,int>;

int read() {
	int x = 0; bool f = 0; char ch = getchar();
	while(!isdigit(ch)) f |= ch == '-',ch = getchar();
	while(isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48),ch = getchar();
	return f ? -x : x;
}

const int N = 1e5 + 10;

int lmn[N],lmx[N],rmn[N],rmx[N],n,m,k[N],al[N],ar[N],bl[N],br[N];

int main() {
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	n = in,m = in;
	for(int i = 1;i <= n;i++) k[i] = in,al[i] = in,bl[i] = in,ar[i] = in,br[i] = in;
	lmx[n + 1] = rmx[n + 1] = m;
	for(int i = n;i >= 1;i--) {
		if(k[i] >= al[i] && k[i] <= bl[i]) {
			if(k[i] >= rmn[i + 1] && k[i] <= rmx[i + 1]) lmn[i] = ar[i],lmx[i] = br[i];
			else lmn[i] = max(ar[i],lmn[i + 1]),lmx[i] = min(br[i],lmx[i + 1]);
		} else lmn[i] = m,lmx[i] = 0;
		if(k[i] >= ar[i] && k[i] <= br[i]) {
			if(k[i] >= lmn[i + 1] && k[i] <= lmx[i + 1]) rmn[i] = al[i],rmx[i] = bl[i];
			else rmn[i] = max(al[i],rmn[i + 1]),rmx[i] = min(bl[i],rmx[i + 1]);
		} else rmn[i] = m,rmx[i] = 0;
	}
	int l = 0,r = 0;
	if(lmn[1] && rmn[1]) return puts("No"),0;
	puts("Yes");
	for(int i = 1;i <= n;i++) {
		if(r >= lmn[i] && r <= lmx[i]) l = k[i],printf("0 ");
		else r = k[i],printf("1 ");
	}
	puts("");
	return 0;
}
